﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;

namespace SignalRTest
{
    public class GroupHub : Hub
    {
        public void AddGroup(string groupName)
        {
            Groups.Add(this.Context.ConnectionId, groupName);
        }

        public void SendGroupMsg(string groupName, string msg)
        {
            Clients.OthersInGroup(groupName).onMessage(msg);
            Clients.OthersInGroup(groupName).onMessage1(msg);
        }
    }
}